import i18n from '@root/i18n'

var bed = world.querySelector('.床')   //名称需与模型的名称保持一致
if (bed) {
    bed.enableInteract = true
    bed.interactRadius = 4
    bed.interactHint = `互动 Interact`

    bed.onInteract(async ({ entity }) => {
        if (!entity.safe) {
            entity.position.set(72, 10, 70)
            entity.safe = true

        }
        else {
            entity.position.set(75, 12, 72)
            entity.safe = false
        }
    })
}
world.onPlayerJoin(async ({ entity }) => {
    entity.safe = false
})